Tag: til

Blog Posts

Document extraction: four main approaches with a 1000x cost difference

I looked at the four main ways to turn unstructured documents into structured data: full LLM inference, fine-tuned small models, template-based extraction, and cloud OCR services.

The cost difference is huge: template-based extraction costs $0.001 per document, while full LLM inference costs $...

Multi-Head Attention: Full Input Projection Not Slicing

A critical clarification about how multi-head attention works in Transformers: Each attention head receives the entire input embedding, not a slice of it.

The Common Misconception

Many explanations suggest that with 768 dimensions and 12 heads, each head gets a different 64-dimension...

Flask's `g` - The "Global" That Isn't

Today I learned why Flask's request context object is called g, and it's too clever by half.

I was reviewing a Flask codebase and kept seeing this pattern:

```python from flask import g

def get_db(): if "db" not in g: g.db = sqlite3.connect("app.db") return g.db ``...

AWS DMS for Simple CDC Pipelines

AWS DMS (Database Migration Service) is often overlooked as a CDC tool because of its migration-focused marketing, but it's actually excellent for simple change data capture pipelines.

Key advantages for CDC use cases:

  1. Native Aurora integration - Built-in support for Aurora Postgr...

Reranking

On Reranking

I've been seeing the term reranking everywhere in RAG retrieval discussions, and it finally clicked that this isn't just a general concept. It's a specialized technical term with a specific job. After your initial retrieval grabs documents, they get re-scored and reshuffled u...